QuickTime 3 Reference

Previous | Chapter Top | Chapter Contents | Next

Importing a Standard MIDI File as a Movie Using the Movie Toolbox

Most music content exists in a format called Standard MIDI File (SMF). All sequencing and composition programs have an option to Save As or Export files to this format. QuickTime provides facilities for reading an SMF file and converting it into a QuickTime movie. During any kind of conversion, the SMF file is assumed to be scored for a General MIDI device, and MIDI channel 10 is assumed to be a drum track.

The conversion to a QuickTime movie can happen in one of several ways. Because it is implemented in a QuickTime 'eat ' component, the conversion will happen automatically in most cases. Any application that uses the StandardGetFile routine to open a movie can also open 'Midi' files transparently, and can transparently paste Clipboard contents of type 'Midi' into a movie shown with the standard movie controller.

To explicitly convert a file or handle into a movie, your application can use the Movie Toolbox routines ConvertFileToMovieFile and PasteHandleIntoMovie , respectively.

When authoring MIDI files to be converted to QuickTime music movies, two MIDI system-exclusive messages can be used for more precise control of the MIDI import process. Note that QuickTime data is divided into media samples. Within video tracks, each video frame is considered one sample; in music tracks, each sample may contain several seconds worth of musical information.

sets the maximum size of each media sample to the 21-bit number xxyyzz . (MIDI data bytes have the high bit clear, so they have only seven bits of number.) This message can occur anywhere in an SMF file.

marks an immediate sample break; it ends the current sample and starts a new one. All messages after a sample break message will be placed in a new media sample.

Applications can define their own system-exclusive messages of the form F0 11 7F ww xx yy zz ... application-defined data ... F7 , where ww xx yy zz is the application's unique signature with the high bits cleared. This is guaranteed not to interfere with Apple's or any other manufacturer's use of system-exclusive codes.


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next